<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>消息框</title>
    <script>
        function f1() {
            alert("警告框")
        }

        function f2() {
            let s = confirm("是否确认?");
            alert(s);
        }

        function f3() {
            // let s = prompt("请输入");
            let s = prompt("请输入", "admin");
            alert("您输入的数据:" + s)
        }
    </script>
</head>
<body>
<button onclick="f1()">警告框</button>
<br>
<button onclick="f2()">确认框</button>
<br>
<button onclick="f3()">输入框</button>
<br>
</body>
</html>